var app = angular.module('FusionV3', []);

app.controller('manageConnectionsController', [
		'$scope',
		'$http',
		function($scope, $http) {

			$scope.connections;

			$scope.init = function() {
				debugger;
				$http.get("../rest/configuration/findConnectionsByAccount")
						.success(function(data) {
							debugger;
							if (data.result)
								$scope.connections = data.result;
							else
								$scope.msg = "error";
						}).error(function(data) {
							console.log(data);
						});

			}

			$scope.checkLogin = function() {

				$http.post("rest/account/login", {
					userName : $scope.userName,
					password : $scope.password
				}).success(function(data) {
					debugger;
					if (data.result) {
						window.location.href = "server/server";
					} else {
						$scope.msg = "password error!";
					}

				}).error(function(data) {
					console.log(data);
				});

			}

		}]);